home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_olv_bosspad.cog < prev    next >
Text File  |  1999-11-15  |  6KB  |  258 lines

  1. # Jones 3D Cog Script
  2. #
  3. # olv_bosspad.cog
  4. #
  5. # Cog to move snake bridges using pads.
  6. #
  7. # [DS]
  8. #
  9. # (C) 1999 LucasArts Entertainment Company LLC. All Rights Reserved
  10. #
  11. # ===================================================================
  12.  
  13. symbols
  14.  
  15.     message    startup
  16.     message     entered
  17.     message     exited
  18.     message    arrived
  19.     message    activated
  20.     message    timer
  21.  
  22.  
  23.     thing        block0
  24.     thing        imp3
  25.     thing        imp_stand
  26.     surface     pad0                   mask=0x480
  27.     
  28. sound        plyersnd=inxj054.wav            local    # "Must be a presure switch"
  29. sound        switchsnd=olv_presswitch_c.wav    local
  30. sound        blocksnd=olv_quetzdoor_move_c.wav    local
  31. sound        blockstop=olv_quetzdoor_stop_c.wav    local
  32. int        sndplay                    local
  33. int        steptalk                    local
  34. int        redystep=0                    local    
  35. int        gotten=0                    local    
  36. int        talkin                    local    
  37. int        aha                        local
  38. int        block_up=0                    local
  39. int        waittime=30                    local
  40. thing        player                    local
  41.  
  42. #   Gestures.
  43. keyframe    in_scratch=0in_scrtch_1_1.key        local
  44. keyframe    in_ltarmup=0in_leftarm_1_1.key    local
  45. keyframe    in_1to4=0in_stand1_bd_4.key        local
  46. keyframe    in_stand4=0in_stand4.key        local
  47. keyframe    in_botharmsup=0in_armsup_1_1.key    local
  48. keyframe    in_rtarmup=0in_armsout_1_1.key    local
  49.  
  50. int        track                        local
  51. int        direction=0                    local
  52. int        difficultylevel                local
  53. int        diff_time                    local
  54.  
  55. vector    playervec                    local
  56. vector    playerxvec                    local
  57.  
  58. # ------------ Voice Lines ---------------------------
  59. sound        ahaSnd=INXJ147.wav            local # Aha...
  60. sound        read0=ov05j01.wav                local    #Heres what I'm looking for.
  61. sound        read0b=ov05j02.wav                local    #Harken Mortal!...(version1)
  62. sound        read1=ov05j03.wav                local    #Harken Mortal!...(version2)
  63. sound        read2=ov05j04.wav                local    #Hmm...Sounds like..could fly...
  64.  
  65. # sound        readend=ov05j02a.wav            local    #[sigh]Why are these inscriptions...
  66.  
  67. int        sndnum=1                    local
  68.  
  69. end
  70.  
  71. #----------------------------------------------------------------------
  72. code
  73. startup:
  74.     player=GetLocalPlayerThing();
  75.     ClearThingFlags(block0, 0x40000000);    # block not pushable. 
  76.      return;
  77.  
  78. entered:
  79.     if(getsenderref() != pad0) return;
  80.     PlaySoundLocal(switchsnd, 1.0, 0.0, 0x0, 0);
  81.         if(redystep == 0)
  82.         {        
  83.         steptalk = PlayVoice(player, plyersnd, 1.0, 0);
  84.         redystep=1;
  85.         }
  86.     if(block_up == 1) return;
  87.       MoveToFrame(block0, 1, 1.0);
  88.     sndplay = PlaySoundThing(blocksnd, block0, 1, 10, 50, 1);
  89.     return;
  90.  
  91.     
  92. exited:
  93.     if(getsenderref() != pad0) return;
  94.     if(block_up == 1) return;
  95.     block_up=1;
  96.     PlaySoundLocal(switchsnd, 1.0, 0.0, 0x0, 0);
  97.  
  98.  
  99.         # TO DO:  Shouldn't timer be related to difficulty?
  100.         difficultylevel=GetDifficulty();
  101.         diff_time=waittime+((5 - difficultylevel)* 6.0);
  102.         SetTimer(diff_time);
  103.  
  104.     return;
  105.  
  106.  
  107. timer:
  108.     block_up=0;
  109.       MoveToFrame(block0, 0, 1.0);
  110.     sndplay = PlaySoundThing(blocksnd, block0, 1, 10, 50, 1);
  111.     return;
  112.  
  113. arrived:
  114.     if(GetSenderRef() == block0)
  115.     { 
  116.     StopSound(sndplay, 0);
  117.     PlaySoundThing(blockstop, block0, 1, 20, 50, 0);
  118.     }
  119.     return;
  120.  
  121. activated:
  122.     playervec=GetThingLVec(player);
  123.     playerxvec=VectorX(playervec);
  124. #    printflex(playerxvec);
  125.  
  126.     if((getsenderref() == imp_stand) && (gotten == 0))    
  127.     {
  128.         gotten=1;
  129.         StartCutscene(1);
  130.         SetActorFlags(player, 0x200000);
  131.         MakeMeStop();
  132.         DeselectWeaponWait(player);
  133.         aha = PlayVoice(player, ahasnd, 1.0, 0);
  134.  
  135.         # ----- Set Cam Offset ---------
  136.         if(playerxvec >= -0.3)
  137.         {
  138.             SetExtCamOffset('-0.15 -0.07 0.04');
  139.         direction=1;
  140. #        print("facing from right");
  141.         }
  142.         else
  143.         {
  144.             SetExtCamOffset('0.15 -0.07 0.04');
  145.         direction=0;    
  146. #        print("facing from left");
  147.         }
  148.           PlayMode(player, 60, 0);
  149.         Sleep(0.5);
  150.         DestroyThing(imp3);
  151.  
  152.         UpdateDifficulty(difficultylevel);
  153.  
  154.         # ----- Add Imp3 ---------
  155.         ChangeInv(player, 16, 1.0);
  156.         SetInvAvailable(player, 16, 1);
  157.         JonesInvItemChanged(16);
  158.         Sleep(4.0);
  159.  
  160.         talkin = PlayVoice(player, read0, 1.0, 0);
  161.         PlayKey(player, in_botharmsup, 4, 0x12, 0);
  162.         WaitForSound(talkin);
  163.         sleep(0.5);
  164.         talkin = PlayVoice(player, read0b, 1.0, 0);
  165.             if(direction == 1)
  166.             {
  167.             PlayKey(player, in_ltarmup, 4, 0x12, 0);
  168.             }
  169.             else
  170.             {
  171.             PlayKey(player, in_rtarmup, 4, 0x12, 0);
  172.             }
  173.         sleep(8.0);
  174.         PlayKey(player, in_scratch, 4, 0x12, 0);
  175.         WaitForSound(talkin);
  176.  
  177.         # ----- Reset Camera ----------
  178. #        print("end 1");
  179.         RestoreExtCam();
  180.         ClearActorFlags(player, 0x200000);
  181.         EndCutscene();
  182.         gotten=2;
  183.         return;
  184.     }
  185.     if((getsenderref() == imp_stand) && (gotten == 2))    
  186.     {
  187.         gotten=3;
  188.         StartCutscene(1);
  189.         SetActorFlags(player, 0x200000);
  190.         MakeMeStop();
  191.         DeselectWeaponWait(player);
  192.  
  193.         # ----- Set Cam Offset ---------
  194.         if(playerxvec >= -0.3)
  195.         {
  196.             SetExtCamOffset('-0.15 -0.07 0.04');
  197.         direction=1;
  198. #        print("facing from right");
  199.         }
  200.         else
  201.         {
  202.             SetExtCamOffset('0.15 -0.07 0.04');
  203.         direction=0;
  204. #        print("facing from left");
  205.         }
  206.  
  207.         if(sndnum == 1)
  208.         {
  209.             talkin = PlayVoice(player, read1, 1.0, 0);
  210.             PlayKey(player, in_botharmsup, 4, 0x12, 0);
  211.             sleep(4.0);
  212.             if(direction == 1)
  213.             {
  214.             PlayKey(player, in_ltarmup, 4, 0x12, 0);
  215.             }
  216.             else
  217.             {
  218.             PlayKey(player, in_rtarmup, 4, 0x12, 0);
  219.             }
  220.             WaitForSound(talkin);
  221.         }
  222.         if(sndnum >= 2)
  223.         {
  224.             talkin = PlayVoice(player, read2, 1.0, 0);
  225.             track = PlayKey(player, in_Stand4, 2, 0x0, 0);
  226.             PlayKey(player, in_1to4, 4, 0x12, 1);
  227.             sleep(2.0);
  228.             StopKey(player, track, 0.5);
  229.             sleep(1.0);
  230.             if(direction == 1)
  231.             {
  232.             PlayKey(player, in_ltarmup, 4, 0x12, 0);
  233.             }
  234.             else
  235.             {
  236.             PlayKey(player, in_rtarmup, 4, 0x12, 0);
  237.             }
  238.             WaitForSound(talkin);
  239.         }
  240.  
  241.         sndnum = (sndnum + 1);
  242.         if(sndnum >= 2)
  243.         {
  244.         sndnum = 2;
  245.         }
  246.  
  247.         # ----- Reset Camera ----------
  248. #        print("end 2");
  249.         RestoreExtCam();
  250.         ClearActorFlags(player, 0x200000);
  251.         EndCutscene();
  252.         gotten=2;
  253.     }
  254.     return;
  255.  
  256. end
  257.  
  258.